Skip to content

Image Snapshot Tests#13

Merged
joerick merged 9 commits intonordprojects:masterfrom
notjosh:chore/image-snapshot-tests
Apr 26, 2020
Merged

Image Snapshot Tests#13
joerick merged 9 commits intonordprojects:masterfrom
notjosh:chore/image-snapshot-tests

Conversation

@notjosh
Copy link
Collaborator

@notjosh notjosh commented Oct 14, 2019

The comments on #8 made me think more about image snapshot tests, to make sure we're not accidentally causing regressions in the HTML->image chain(s). Since #8 changes the renderer, it's probably a good idea to get these tests in sooner rather than later.

There are only a couple of simple tests for now, but we can add cases when we find issues, and it's enough (imo!) to catch any obvious issues.

Couple of things:

  • because of fonts/font rendering, we should only run/care about test results from Docker environment for consistency
  • added a make ci-snapshot-update task to bump the snapshots
  • mounted the entire repo as a volume in the dev/test Docker environments (finally!) for quicker feedback loops

@notjosh notjosh mentioned this pull request Oct 14, 2019
@notjosh
Copy link
Collaborator Author

notjosh commented Oct 14, 2019

Sidebar: would be nice to get the CI status inline here. I think that means bumping some API keys for the integration? Been a while since I've set it up.

Nevertheless, tests are green here: https://circleci.com/gh/notjosh/sirius/5

Copy link
Member

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one. I'm interested to see how this turns out.

Just one thing needs fixing here, I think.

BTW, I added PR test runs to Circle, was just a missing checkbox on the settings.

# https://pypi.python.org/pypi/scrubber

def default_template(raw_html, from_name):
def default_template(raw_html, from_name, date=datetime.datetime.now()):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetime.datetime.now() will be evaluated only once, when the function is defined. Better to assign None as a default and test if date is None: in the function body to set a default

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I didn't know that! Good catch, and noted for future. Fixed in 044be3b

@notjosh
Copy link
Collaborator Author

notjosh commented Oct 14, 2019

BTW, I added PR test runs to Circle, was just a missing checkbox on the settings.

🎉

Copy link
Member

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, been busy! Looks good, merge whenever you're ready :)

@joerick
Copy link
Member

joerick commented Apr 26, 2020

I could use faster tests, so I'm gonna merge :)

@joerick joerick merged commit 863241f into nordprojects:master Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants